Skip to content

Conversation

@patchwork-systems
Copy link

This PR separates the ReactionAddReply class in a way that provides 2 classes, one with the full previous functionality and one that is safe to use in Direct Messages with more limited permissions!

Asterisk* added 3 commits July 7, 2021 23:04
Documentation states that Reply super classes should be able to accept a Callable and the Callable will recieve the reply object.

Currently the Callable does not recieve the reply object.
Because ReactionAddReply uses message.remove_reaction() and message.clear_reactions(), they cannot be used in direct messages.

This PR separates ReactionAddReply into two classes

DirectMessageReactionAddReply(ReactionAddBasic) which takes on_reply_init and reply_check
ReactionAddReply(DirectMessageReactionAddReply) which adds on_reply_attempt and on_reply_complete

----

Having a class that works by default with DM's seems like a fairly common use case.
@cysabi
Copy link
Owner

cysabi commented Jul 10, 2021

This is helpful!

May I suggest, instead of separating a DM safe variant into it's own class, adding try/except or if statements?

For example:

if isinstance(self.ctx.channel, discord.DMChannel):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants